import 'package:dmz/base/pageWidget/base_stateful_widget.dart';

import 'package:dmz/base/widget/load_state_widget.dart';
import 'package:dmz/business/home/controller/map_location_controller.dart';
import 'package:dmz/business/home/widgets/map_widgets.dart';
import 'package:dmz/tools/map/map_widget.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class MotoNavigationPage extends BaseStatefulWidget<MotoLocationController> {
  @override
  String titleString() => '骑行导航'.tr;

  @override
  bool showBackButton() => true;

  @override
  Widget buildContent(BuildContext context) {
    return controller.initLatLng == null
        ? createEmptyWidget(controller)
        : Stack(children: [
            EMIGDMapWidget(
              latLng: controller.initLatLng,
              onMapCreated: (controllered) =>
                  controller.mapController = controllered,
              initMarkerMap: controller.markerMap,
            ),
            MapWidgets.searchWidget()
          ]);
  }
}
